Repository navigation
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the shadcn CLI installs a component into a Base UI project, it rewrites every literal
asChildintorender={<Child />}. diceui's primitives only tookasChild, so the Base UI registry items broke: they failed to typecheck and rendered the wrong element. Examples are the check icon going missing inui/checkbox-group, the mention demos rendering aninputinstead of the textarea, andTagsInputClearlosing its Button.Primitivepart in@diceui/sharedaccepts arenderelement, like Base UI'srenderin its element form. Props, refs, handlers,classNameandstylemerge through the sameSlotthatasChilduses. When the part has children, they replace the element's own; when it has none, the element keeps its own. That covers both shapes the CLI produces.ComboboxArrowkeeps custom content withrender, the way it already did withasChild.@diceui/shared,checkbox-group,combobox,mentionandtags-input.@diceui/listboxhas its ownSlot, and nothing in the registry usesasChildon it, so it's left as is.renderonPrimitive, and forComboboxArrowcontent with bothasChildandrender.I checked this against the CLI's own transform (
transform-aschildfrom@shadcn/registry). I applied it to the 8 Base UI registry files that useasChildon these primitives, then reverted them.main's packages, 0 with this change.asChildversion, 7 of 8 files differ againstmain's packages, and all 8 match with this change.tags-input-demomatches either way, because Clear isn't rendered with no tags.Faceted has the same problem with cmdk's
Command.Item. That's third-party, so tablecn fixes it on its side (sadmann7/tablecn#1337), and the fix reaches diceui with the next sync.